package com.carkeeper.common.exception;


import com.carkeeper.common.dtos.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {
    /**
     * 拦截业务异常
     *
     */
    public Result handleLeadNewsException(LeadNewsException e) {
        return Result.errorMessage(e.getMessage(),e.getStatus(),null);
    }

    @ExceptionHandler(value = Exception.class)
    public Result handleException(Exception e) {
        return Result.error();
    }
}
